package models

import (
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

type User struct {
	id    int
	name  string
	email string
}

func init() {
	orm.RegisterDriver("mysql", orm.DR_MySQL)
	orm.RegisterDataBase("default", "mysql", "hoolay:hl_1234@/hoolay?charset=utf8")
}

func GetUserData() ([]orm.Params, int64) {

	o := orm.NewOrm()

	var data []orm.Params

	num, _ := o.Raw("select * from users limit ? ", 20).Values(&data)

	return data, num

}
